Skip to content

Phase-encoded policies can run as skills - #449

Open
mvanhorn wants to merge 13 commits into
pollen-robotics:mainfrom
mvanhorn:feat/phase-skills
Open

mvanhorn wants to merge 13 commits into
pollen-robotics:mainfrom
mvanhorn:feat/phase-skills

Conversation

@mvanhorn

@mvanhorn mvanhorn commented Oct 24, 2026 •

Copy link
Copy Markdown

A policy that needs a clock can now be added as a skill instead of having to take over the ground-pick slot.

robotctl policy add accepts command.encoding = "phase". While the skill runs, the daemon writes [cos 2πφ, sin 2πφ, 0] into the twist slots, with φ starting at 0 and advancing at 1 / period_s. That's the same encoding the ground pick uses, and the same code produces it.

  • episodic: hands back at end_phase, the way the ground pick does (duration_s = period_s × end_phase).
  • perpetual with --hold: φ wraps, so the policy loops, and after the hold it unwinds on command.idle like any other perpetual skill. Leaving out --hold is refused.
  • A missing or non-positive period_s is refused. posture_flag is still refused.
  • API_VERSION is bumped, so an older daemon refuses a phase skill entry rather than running it on a constant command.

Scale and gain follow the existing rules: the manifest's action_scale and the full gain apply.

The per-run phase-rate override from the issue (locking a dance to the music) is left for later. A fixed period_s from the manifest is enough to run a routine on the robot.

Tests cover policy add accepting and refusing each combination, the twist slots tracking the phase over time, the episodic hand-back, the perpetual wrap and unwind, and the ground pick's behaviour, which is pinned unchanged. cargo test --workspace passes.

Closes #388

Demo

Demo

demo

mvanhorn and others added 2 commits October 24, 2026 20:16
The daemon feeds it [cos 2πφ, sin 2πφ, 0] the way the ground pick
already does. Episodic hands back at end_phase; perpetual still
needs --hold and wraps. SkillParams gained those members, so
API_VERSION is 45: a v44 daemon would ignore them and run a phase
policy on a constant command. posture_flag stays a sit↔stand.
@mvanhorn

Copy link
Copy Markdown
Author

The API version moved under this one: 95bbc7c merges main, which has since taken v45 (vet book gallery) and v46 (OS update), so the phase-encoded skill bump is now v47, and the doc comments that pointed at a v44 robotd now say v46. cargo test -p duck-ipc-proto passes and robotctl and robotd build.

Main took API v47 for the telemetry routes, so the phase-encoded skill
bump moves to v48 and its doc comments now name a v47 robotd.
@mvanhorn

Copy link
Copy Markdown
Author

Main took v47 for the telemetry routes in the meantime, so 80e6bd1 merges main and moves the phase-encoded skill bump to v48. The doc comments that named a v46 robotd now say v47.

cargo test -p duck-ipc-proto and cargo test -p robotd-params pass, cargo fmt --all --check and clippy on those crates plus robotctl are clean, and robotctl and robotd build.

@mvanhorn

mvanhorn commented Nov 5, 2026

Copy link
Copy Markdown
Author

Main took v50 for the WebRTC remote-session check, so bdad412 merges main and moves the phase-encoded skill bump to v51. The doc comments that named a v49 robotd now say v50.

@mvanhorn

mvanhorn commented Nov 6, 2026

Copy link
Copy Markdown
Author

Main took v51 for the pad pairing candidates, so 5aa9656 merges main and moves the phase-encoded skill bump to v52. The doc comments that named a v50 robotd now say v51.

@mvanhorn

Copy link
Copy Markdown
Author

Main took v52 for laser tracking and v53 for the impact guard, so 225d887 merges main and moves the phase-encoded skill bump to v54. The doc comments that named a v51 robotd now say v53.

@mvanhorn

Copy link
Copy Markdown
Author

Main took v54 to v57 for wifi ssh over BLE, its withdrawal, NFC tag writes and join progress, so c771e96 merges main and moves the phase-encoded skill bump to v58. The doc comments that named a v53 robotd now say v57.

@mvanhorn

Copy link
Copy Markdown
Author

Main took v58 to v61 for soccer mode, the onboard map, autod's brain and NFC tag reads, so 3e68799 merges main and moves the phase-encoded skill bump to v62. The doc comments that named a v57 robotd now say v61.

Main took v62 for the battery's Goal PWM in robot.health, so this moves
the phase-encoded skill bump to v63. The doc comments that named a v61
`robotd` now say v62.
@mvanhorn

Copy link
Copy Markdown
Author

Main took v62 for the battery Goal PWM in robot.health, so cedf2ba merges main and moves the phase-encoded skill bump to v63. The doc comments that named a v61 robotd now say v62.

Main took v63 to v66 for bwep, photo.list/get/delete, the pad's battery
and the speaker volume, so the phase-encoded skill bump moves to v67.
The doc comments that named a v62 `robotd` now say v66.
@mvanhorn

Copy link
Copy Markdown
Author

Main took v63 to v66 for bwep, photo list/get/delete, the pad's battery and the speaker volume, so d7fa40e merges main and moves the phase-encoded skill bump to v67. The doc comments that named a v62 robotd now say v66.

Main took v67 for every switch in robot.mode with the play modes over
Bluetooth, and v68 for photo.take, so the phase-encoded skill bump moves
to v69. The doc comments that named a v66 `robotd` now say v68.
@mvanhorn

Copy link
Copy Markdown
Author

Main took v67 for every switch in robot.mode with the play modes over Bluetooth, and v68 for photo.take, so 1fe4355 merges main and moves the phase-encoded skill bump to v69. The doc comments that named a v66 robotd now say v68.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

A community skill can't be phase-driven: phase encoding only reaches the ground-pick slot

1 participant